package br.com.exemplo.vendas.apresentacao.mb;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.exemplo.vendas.apresentacao.service.Service;
import br.com.exemplo.vendas.negocio.model.vo.ComprasVO;
import br.com.exemplo.vendas.util.exception.LayerException;

@ManagedBean
@RequestScoped
public class ComprasMB {
	
	private List<ComprasVO> lista = new ArrayList<>();
	
	public String listarCompras(){
		
		Service service = new Service();
		try {
			lista = service.listarComprasServicoA();
		} catch (LayerException e) {
			e.printStackTrace();
		}
		
		return "/pages/listarCompras";
	}
	
	public List<ComprasVO> getLista() {
		return lista;
	}

	public void setLista(List<ComprasVO> lista) {
		this.lista = lista;
	}

}
